<% present entry, local_assigns do |entry_presenter| %>
<div class="tweet <%= entry_presenter.tweet_classes(tweet) %>">
    <header class="tweet-header">
        <div class="profile-wrap">
            <div class="profile-image-wrap" data-behavior="author_profile_wrap">
                <%= content_tag :button, title: "View Profile", class: "profile-image reset", data: {behavior: "toggle_profile"}  do %>
                    <%= image_tag_with_fallback(image_url("favicon-profile-default.png"), entry_presenter.tweet_profile_image_uri(tweet), size: "47x47", alt: "") %>
                <% end %>
                <div class="author-profile hide" data-behavior="author_profile">
                    <%= entry_presenter.tweet_profile_banner(tweet) %>
                    <div class="author-profile-inner">
                        <header class="tweet-header">
                            <div class="profile-wrap">
                                <%= link_to entry_presenter.tweet_user_url(tweet), target: "_blank", title: "View on Twitter", class: "profile-image" do %>
                                    <%= image_tag_with_fallback(image_url("favicon-profile-default.png"), entry_presenter.tweet_profile_image_uri(tweet, :original), width: "100%", alt: "", class: "large") %>
                                <% end %>
                            </div>
                            <div class="profile-info">
                                <h1>
                                    <a href="<%= tweet.uri.to_s %>" target="_blank" class="link">
                                        <strong>
                                            <%= entry_presenter.tweet_name(tweet) %>
                                            <% if entry_presenter.tweet_author_verified?(tweet) %>
                                                <%= svg_tag "icon-verified" %>
                                            <% end %>
                                        </strong>
                                        <br>
                                        <%= entry_presenter.tweet_screen_name(tweet) %>
                                    </a>
                                </h1>
                            </div>
                        </header>
                        <div class="tweet-body">
                            <div class="tweet-body-inner">
                                <%= entry_presenter.tweet_author_description(tweet) %>
                                <p class="tweet-text profile-meta-wrap">
                                    <span class="profile-meta joined" title="Joined">
                                        <span class="calendar-icon">
                                            <%= svg_tag "icon-calendar" %>
                                            <span class="date">
                                                <% entry_presenter.tweet_author_joined_day(tweet).each do |number| %>
                                                    <%= svg_tag "icon-number-#{number}" %>
                                                <% end %>
                                            </span>
                                        </span>
                                        <time datetime="<%= entry_presenter.tweet_author_joined_datetime(tweet) %>"><%= entry_presenter.tweet_author_joined(tweet) %></time>
                                    </span>
                                    <% if entry_presenter.tweet_author_location?(tweet) %>
                                    <span class="profile-meta" title="Location: <%= entry_presenter.tweet_author_location(tweet) %>">
                                        <%= svg_tag "icon-location" %>
                                        <span><%= entry_presenter.tweet_author_location(tweet) %></span>
                                    </span>
                                    <% end %>
                                </p>
                                <p class="tweet-text profile-meta-wrap">
                                    <span class="profile-meta">
                                        <strong><%= short_number(tweet.user.friends_count) %></strong> Following
                                    </span>
                                    <span class="profile-meta">
                                        <strong><%= short_number(tweet.user.followers_count) %></strong> <%= "Follower".pluralize(tweet.user.followers_count) %>
                                    </span>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="profile-info">
                <h1>
                    <a href="<%= tweet.uri.to_s %>" target="_blank" class="link">
                        <strong><%= entry_presenter.tweet_name(tweet) %></strong>
                        <%= entry_presenter.tweet_screen_name(tweet) %>
                    </a>
                    <span class="tweet-actions">
                        <%= link_to tweet.uri.to_s, target: "_blank", title: "View on Twitter", class: "tweet-link", id: "source_link" do %>
                            <%= svg_tag "icon-twitter-logo" %>
                        <% end %>
                    </span>
                </h1>
                <p class="post-meta">
                  <%= link_to tweet.uri.to_s, target: "_blank", title: "View on Twitter" do %>
                      <time datetime="<%= tweet.created_at.iso8601 %>">
                          <%= tweet.created_at.to_formatted_s(:full_human) %>
                      </time>
                  <% end %>
                  <span class="tweet-location">
                      <% if entry_presenter.tweet_location(tweet) %>
                          from <%= entry_presenter.tweet_location(tweet) %>
                      <% end %>
                  </span>
                </p>
            </div>
        </div>
    </header>
    <div class="tweet-body">
        <div class="tweet-body-inner">
            <%= entry_presenter.tweet_in_reply_to(tweet) %>
            <%= entry_presenter.tweet_text(tweet) %>
            <% if local_assigns[:tweet_counter] && tweet_counter == 0 %>
                <% if tweet.quoted_status? %>
                    <%= render partial: "shared/tweet", locals: {entry: entry, tweet: tweet.quoted_status, css: "quoted-tweet"} %>
                <% end %>
            <% end %>
            <% if local_assigns[:include_media] && include_media %>
                <% tweet.media.take(1).each do |media| %>
                    <% if entry_presenter.tweet_video?(media) %>
                        <%= entry_presenter.tweet_video(media) %>
                    <% else %>
                        <%= link_to media.media_url_https.to_s + ":4096x4096" do %>
                            <%= image_tag camo_link(media.media_url_https.to_s + ":large"), class: "responsive" %>
                        <% end %>
                    <% end %>
                <% end %>
            <% end %>
        </div>
    </div>
</div>
<% end %>

